package com.atguigu.crud.service;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.atguigu.weixin.kit.SecurtiyKit;
import com.atguigu.weixin.kit.WeixinKit;
import com.atguigu.weixin.model.WeixinFianlValue;

@Service("wxkfService")
public class WxkfService {
  
	//添加多客服
	public void add(String account,String nickname,String password){
		String url=WeixinKit.replaceAccToken(WeixinFianlValue.KF_ADD);
		Map<String,String> maps=new HashMap<String,String>();
		maps.put("kf_account", account+"@misung58");//客服帐号
		maps.put("nickname", nickname);//昵称
		maps.put("password", SecurtiyKit.md5(password));//密码要md5加密
	    String json=WeixinKit.sendJsonPost(url, JSON.toJSONString(maps));
	    System.out.println("________kf________"+json);
	}
	
}
